home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / comm / cnet / edp2days.lha / EDPTwoDays.Rexx < prev    next >
OS/2 REXX Batch file  |  1997-02-22  |  8KB  |  218 lines

  1. /*
  2.  
  3. TwoDays.Rexx version 2.1 by Edward Peyton
  4.  
  5. Galt AKA Edward D. Peyton
  6. Atlantis BBS: (904) 479-3133 | 479-4080
  7. WebSite: http://www.pen.net/~atlantis
  8. email : edp@pen.net  Edward Peyton@1:3612/369.0
  9. snailmail:
  10. 5100 N 9th Ave F-601
  11. Pensacola, FL 32504
  12.  
  13. This program will log and SHOW ALL callers to your bbs on a given day,
  14. ALL callers to the bbs for YESTERDAY, and, if you enable it, a GUESS as
  15. to the callers you will have tomorrow. <G> I guess it should be called
  16. EDPThreedays.rexx. The idea for the Tommorrow command was not mine, BTW,
  17. I just added it at a rather insane users' suggestion. I hope that doesn't
  18. make me insane as well. :)
  19.  
  20. Read the docs for installation, and check the settings below!
  21. Very important!
  22.  
  23. */
  24.  
  25. /* -----Sysop definable settings----- */
  26.  
  27. ls=0                             /*0=Don't LOG sysop, 1=LOG sysop*/
  28. log='Sysdata:edptoday.ctxt'      /*Location and name of Log file for TODAY*/
  29. log2='sysdata:edpyesterday.ctxt' /*Location and name of Log file for YESTERDAY*/
  30. log3='sysdata:edptomorrow.ctxt'  /*Location and name of log file for tommorow */
  31. loga='sysdata:edpalltoday.ctxt'  /*Logs All the excluded callers for sysop viewing! */
  32. loga2='sysdata:edpallyest.ctxt'  /* Yesterdays ALL logged callers. */
  33. list='Organization'              /* Choose Organization to list organizations string, or Access Group to list Access group name. */
  34. lista='Access Group'             /* Chosee Organization to list organizations in the log ALL callers, or Access Group to list access group. */
  35. bbs='Atlantis'                   /*How you want your BBS name to read   */
  36. pt=3                             /*Port to NOT log; D to disable   */
  37. group=25                         /* Access group to not log  */
  38. grou=2                           /* another access group to NOT log. */
  39.  
  40. /* ---------------Begin Program-------------*/
  41.  
  42. options results;ss=sendstring;tr=transmit
  43. signal on ERROR;signal on SYNTAX;signal on IOERR
  44. if ~exists(log) then do;call open(file,log,w);call close(file);end
  45. if ~exists(loga) then do;call open(file,loga,w);call close(file);end
  46. getuser 1200044;maint=result
  47. bbsidentify sysop
  48. sn=result
  49. getuser 1
  50. nm=result
  51. getuser 23
  52. port=result
  53. getuser 15;grp=result
  54. getuser 39;uucp=result
  55. if (sn=nm & ls=0) then lg=0
  56. if port=pt then lg=0
  57. if grp=group then lg=0
  58. if grp=grou then lg=0
  59. lock='ram:twodaylock'
  60. getuser 1100461;sex=result
  61.    If sex=0 then name="c9"nm
  62.    If sex=1 then name="cc"nm
  63. arg dis
  64. tm=time('C')
  65. dt=Date('W')
  66. if dis="TODAY" then signal TODAY
  67. if dis="YESTERDAY" then signal YESTERDAY
  68. if dis="TOMORROW" then signal TOMORROW
  69. if exists(lock) then ss 'w1.w2.w1.w1.w1.'
  70. if ~exists(lock) then do;call open(stop,lock,w);call close(stop);end
  71. if dis="CHANGEDAY" then signal CHANGEDAY
  72. getuser 1200016;age=result
  73. getuser 24;baud=result/10
  74. getuser 4;city=result
  75. getuser 22;calls=result
  76. getuser 16;accs=result
  77. getuser 59;org=result
  78. if age<18 then ega='*'
  79. if age>17 then ega=' '
  80. if lg=0 then ega='@'
  81. if lista='Organization' then orga=org
  82. if lista='Access Group' then orga=accs
  83. if open(fi,'ram:EDPtempa',w) then do
  84.    call writeln(fi,("cf"left(ega,1)left(name,19)"c6 "left(city,15)"cb "left(orga,25)"c7"right(port,2)" c2"right(baud,3)"c3"right(tm,8)"c6 "right(calls,5)))
  85.    end
  86. call close(fi)
  87. address command 'join ram:EDPtempa 'loga' to Ram:Loga'
  88. address command 'copy ram:loga 'loga''
  89. address command 'delete ram:loga ram:EDPtempa'
  90. if lg=0 then call LEAVE
  91. if list='Organization' then orga=org
  92. if list='Access Group' then orga=accs
  93. if open(fi,'ram:EDPtemp',w) then do
  94.    call writeln(fi,("cb"left(ega,1)left(name,19)"c6 "left(city,15)"cb "left(orga,25)"c7"right(port,2)" c2"right(baud,3)"c3"right(tm,8)"c6 "right(calls,5)))
  95.    end
  96. call close(fi)
  97. address command 'join ram:EDPtemp 'log' to Ram:LOG'
  98. address command 'copy ram:log 'log''
  99. address command 'delete ram:log ram:EDPtemp'
  100.  
  101. Call LEAVE
  102.  
  103. TODAY:
  104. getuser 1302307;extra=result
  105. if extra="?" then do;changewhere "TodayInfo!";call HELP;end
  106. changewhere "Today!"
  107. tr"n1cf                           All c2Today's cfcallers to ce"bbs" "
  108. tr"c4                      EDPTwoDays.Rexx $VER 2.1 by Galt of Atlantisn1"
  109. tr"c6                              Type TODAY ? for more information.n1 "
  110. if exists(lock) then do;tr 'n2caLogfile is busy, try again in a minute!n1c6';exit;end
  111. if maint=0 then CALL TUSER
  112. if extra= "u" then CALL TUSER
  113. tr"c6 Handle / Node #  Calling From    "lista      "            Pt BPS LogOn   Calls"
  114. ss"c7 ---------------- --------------- ------------------------- - --- ------- -----"
  115. if open(toda,loga,r) then do
  116. sendfile loga
  117. call close(toda)
  118. end
  119. else tr "can1Today's callers logfile is as yet empty!"
  120. exit
  121. TUSER:
  122. tr"c6 Handle / Node #  Calling From    "list       "            Pt BPS LogOn   Calls"
  123. ss"c7 ---------------- --------------- ------------------------- - --- ------- -----"
  124. if open(tod,log,r) then do
  125. sendfile log
  126. call close(tod)
  127. end
  128. else tr "can1Today's callers logfile is as yet empty!"
  129. tr"c6"
  130. Exit
  131.  
  132. YESTERDAY:
  133. changewhere "Yesterday!"
  134. tr"n1cf                           All c2Yesterday's cfcallers to ce"bbs" "
  135. tr"c4                      EDPTwoDays.Rexx $VER 2.1 by Galt of Atlantisn1"
  136. if exists(lock) then do;tr 'caLogfile is busy, try again in a minute!n1c6';exit;end
  137. if maint=0 then call YUSER
  138. tr"c6 Handle / Node #  Calling From    "lista      "            Pt BPS LogOn   Calls"
  139. ss"c7 ---------------- --------------- ------------------------- - --- ------- -----"
  140. if open(yesa,loga2,r) then do
  141. sendfile loga2
  142. call close(yesa)
  143. end
  144. else tr"can1Yesterday's callers logfile is empty! (Sorry!)"
  145. exit
  146. YUSER:
  147. tr"c6 Handle / Node #  Calling From    "list       "            Pt BPS LogOn   Calls"
  148. ss"c7 ---------------- --------------- ------------------------- - --- ------- -----"
  149. if open(yes,log2,r) then do
  150. sendfile log2
  151. call close(yes)
  152. end
  153. else tr"can1Yesterday's callers logfile is empty! (Sorry!)"
  154. tr "c6"
  155. exit
  156.  
  157. TOMORROW:
  158. changewhere "Tomorrow!"
  159. tr"n1cf                            Some of c2Tomorrow's cfcallers to ce"bbs
  160. tr"c7                      EDP3Days.Rexx $VER 1.2ax3.2.r4 by "name"c7 of "bbs"n1"
  161. tr" cfJust a guess, really. :-)n1 "
  162. tr"c6 Handle / Node #  Calling From    Organization             Pt BPS LogOn   Calls"
  163. ss"c7 ---------------- --------------- ------------------------  - --- ------- -----"
  164. if exists(lock) then do;tr 'n1caLogfile is busy, try again in a minute!n1c6';exit;end
  165. if exists('ram:tomfile') then do
  166. tr "can1I don't know who is going to call tomorrow, are you crazy?!? c6Try again in a minute"
  167. exit
  168. end
  169. if exists(log3) then do
  170. call open(file,log3)
  171. block=readln(file)
  172. call close(file)
  173. if block=' ' then do
  174. tr "can1I don't know who is going to call tomorrow, are you crazy?!? "
  175. exit
  176. end
  177. l=RANDOM(,,TIME('S'))
  178. l=RANDOM(85,89)
  179. address command 'Sort 'log3 ' to ram:tomfile COLSTART 'l
  180. sendfile 'ram:tomfile'
  181. address command 'delete ram:tomfile'
  182. end
  183. else tr"can1I don't know who is going to call tomorrow, are you crazy?!?"
  184. tr "c6"
  185. exit
  186.  
  187. CHANGEDAY:
  188. if ~exists(log3) then do;call open(jnk,log3,w);call close(jnk);end
  189. if ~exists(log2) then do;call open(juk,log2,w);call close(juk);end
  190. if ~exists(loga2) then do;call open(junk,loga2,w);call close(junk);end
  191. address command 'delete 'log3
  192. address command 'rename 'log2' 'log3' '
  193. address command 'rename 'log' 'log2' '
  194. address command 'delete 'loga2
  195. address command 'rename 'loga' 'loga2' '
  196. tr 'c9Today is now yesterday, and yesterday is now tomorrow!'
  197. logentry 'EDPTwoDays.Rexx reports:New Days!'
  198. Call LEAVE
  199. HELP:
  200. tr 'n1EDP2Days.rexx, Version 2.1 by Edward D. Peyton.n1'
  201. tr 'This program logs all callers to 'bbs', as well as all TrapDoor Sessions.'
  202. tr 'The TO: and FR: in the Network calls indicate whether it was an OUTgoing,'
  203. tr 'or INcoming Call. Node number, node name, Baud, and time are all logged.'
  204. tr 'The far right field indicates the number of files sent or received.n1'
  205. tr 'The cb*c6 next to a handle indicates they are under 18.'
  206. tr 'Males are in ccBluec6, and Females are in c9Redc6.'
  207. tr 'The rest should be self-explanatory.n1'
  208. exit
  209. LEAVE:
  210. address command 'delete 'lock' '
  211. EXIT
  212. SYNTAX:;ERROR:;IOERR:;address command 'delete 'lock' '
  213. e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)'
  214. e2='  c9Linecf: ce'left(sigl,4)'c9Filecf:';getuser 1311992;a=result
  215. getuser 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1
  216. logentry e2;e=sourceline(sigl);do while e~='';e3='c9Sourcecf: cd'
  217. e3=e3||left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
  218.